package personal.hrsw.mybatisplusdemo.mapper;

import org.apache.ibatis.annotations.*;
import personal.hrsw.mybatisplusdemo.domain.Course;
import personal.hrsw.mybatisplusdemo.domain.Score;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
* @author Administrator
* @description 针对表【score】的数据库操作Mapper
* @createDate 2025-04-24 09:27:24
* @Entity personal.hrsw.mybatisplusdemo.domain.Score
*/
@Mapper
public interface ScoreMapper extends BaseMapper<Score> {
    @Select("select * from score where student_id=#{student_id}")
    @Results({
            @Result(column = "course_id",property = "course",javaType = Course.class,
                    one = @One(select = "personal.hrsw.mybatisplusdemo.mapper.CourseMapper.selectById"))
    })
    public List<Score> selectByStudentId(int student_id);

    @Select("select * from score where course_id=#{course_id}")
    @Results({
            @Result(column = "course_id",property = "course",javaType = Course.class,
                    one = @One(select = "personal.hrsw.mybatisplusdemo.mapper.CourseMapper.selectById"))
    })
    public List<Score> selectByCourseId(int course_id);
}




